package com.list_builder.comparators;

import java.util.Comparator;

import com.list_builder.Person;

public class GenderComparator implements Comparator<Person> 
{

	@Override
	public int compare(Person arg0, Person arg1) {

		if(arg0.getGender().equals(arg1.getGender()))
		{
			return arg0.getLastName().compareTo(arg1.getLastName());
		}
		else
		{
			return arg0.getGender().compareTo(arg1.getGender());
		}
	}

}
